import modules from "./modules";
import { RouterMount, createRouter } from "uni-simple-router";

//初始化
const router = createRouter({
  platform: process.env.VUE_APP_PLATFORM,
  encodeURI: false,
  routes: [...modules], //路由表
});

router.beforeEach((to, from, next) => {
  next();
});
// 全局路由后置守卫
router.afterEach((to) => {
  uni.setNavigationBarTitle({
    title: to.meta.title || "品牌名",
  });
});

export { router, RouterMount };
